const {contextBridge, ipcRenderer} = require('electron')

contextBridge.exposeInMainWorld('electron', {
    version: process.versions.electron,
    saveFile(data) {
        ipcRenderer.send('file-save', data)
    },
    readFile() {
        return ipcRenderer.invoke('file-read')
    },

    getMessage(callback) {
        return ipcRenderer.on('message', callback)
    }
})